<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue初体验</title>
</head>

<!-- [Vue warn]: Do not mount Vue to <html> or <body> - mount to normal elements instead -->
<!-- <body id="app"> -->

<body>
    <div id="app">
        {{dogName}}
        <hr>
        <button @click="sayHi">点我呀</button>
    </div>

    <!-- 1.导入 vue框架 -->
    <script src="./vue.js"></script>
    <!-- 2.编写 js代码 -->
    <script>
        // 3.创建 vue 实例
        let vm = new Vue({
            el: '#app',
            data: {
                dogName: '班长'
            },
            methods: {
                sayHi() {
                    console.log(this)
                }
            }
        })
    </script>
</body>

</html>